<!doctype html>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title>mydialog</title>
    <script type="text/javascript" src="../internal.js"></script>
    <script type="text/javascript" src="jquery.min.js"></script>
    <style type="text/css">
	body{ padding:10px; margin:0;}
    #insertHtml{
        margin: 10px 0px 0px 10px;
        width: 370px;
        height: 220px;
    }
	table,td,tr{ border-collapse: collapse; border-spacing: 0; border:none;}
	ul,li{margin: 0; padding: 0; list-style:none;}
	ul{ margin:10px 0 10px 10px;}
	li{ padding:5px 0;}
	#spwidth,#spheight{ width:32px;}
	a{ text-decoration:none; color:#00578f}
    </style>
    <script type="text/javascript">
       $(function(){
              $("#ykid").blur(function(){
				  if ($("#ykid").val()){
					 var auto="false";
					if ($("#isauto").is(":checked")){
						auto="true";
					}
					$("#ykvideo").html('<embed type="application/x-shockwave-flash" src="youku.swf?VideoIDS='+$("#ykid").val()+'" width="300" height="240" flashvars="isAutoPlay='+auto+'&winType=interior" id="movie_player" quality="high" allowscriptaccess="always" allowfullscreen="true" />')
				}         
              });
       });
 
	</script>
</head>
<body>
<table border="1">
  <tr>
    <td width="300" id="ykvideo"><embed type="application/x-shockwave-flash" src="youku.swf?VideoIDS=XNjY2OTkwMjI0" width="300" height="240" flashvars="isAutoPlay=false&winType=interior" id="movie_player" quality="high" allowscriptaccess="always" allowfullscreen="true" /></td>
    <td width="220" valign="top">
    	<ul>
        	<li>视频ID号:
              <input name="ykid" type="text" id="ykid" size="15" value="">
        	</li>
        	<li><img src="1.jpg" width="232" height="36"  alt=""/></li>
            <li>是否自动播放: <input type="checkbox" id="isauto"> 是</li>
            <li>视频大小 <input type="text" id="spwidth" value="480">×<input type="text" id="spheight" value="400"></li>
        </ul>
    </td>
  </tr>
</table>
<script type="text/javascript">
    dialog.onok = function(){
        // 插入内容到编辑器
		var spnr="";
		if ($("#ykid").val()){
			var auto="false";
			if ($("#isauto").is(":checked")){auto="true"}
			spnr='<embed type="application/x-shockwave-flash" src="http://yjr.bluemark.cn/Public/static/ueditor/dialogs/addyouku/youku.swf?VideoIDS='+$("#ykid").val()+'" width="'+$("#spwidth").val()+'" height="'+$("#spheight").val()+'" flashvars="isAutoPlay='+auto+'&winType=interior" id="movie_player" quality="high" allowscriptaccess="always" allowfullscreen="true" />';
//                        spnr='<embed type="application/x-shockwave-flash" src="/e/extend/ue/dialogs/addyouku/youku.swf?VideoIDS='+$("#ykid").val()+'" width="'+$("#spwidth").val()+'" height="'+$("#spheight").val()+'" flashvars="isAutoPlay='+auto+'&winType=interior" id="movie_player" quality="high" allowscriptaccess="always" allowfullscreen="true" />';
        }
        editor.execCommand('inserthtml',spnr);
    }
    </script>

</body>
</html>